package com.resume.ex;

import com.resume.enums.ExceptionEnum;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 全局异常
 *
 * @author 梁云亮
 */
@ApiModel(value = "自定义全局异常")
@Getter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ResumeException extends RuntimeException {

    // 异常错误编码
    private Integer code;
    // 异常信息
    private String msg;

    public ResumeException(ExceptionEnum exceptionEnum){
        this.code = exceptionEnum.getCode();
        this.msg = exceptionEnum.getMsg();
    }

}
